import util from "@/libs/util";

export default ({ request }) => ({
  /**
   * @description 个人中心
   * @param {Object} data
   */
  USERS_CENTER(data = {}) {
    return request({
      url: "/data/v1/personalCenter",
      method: "post",
      data: data,
    });
  },
  /**
   * 获取首页数据
   */
  INDEX_DATA() {
    let userinfo = util.store.getItem("userinfo");
    return request({
      url: "/data/v1/index",
      method: "post",
      data: userinfo
        ? {
            id: userinfo.user_id,
          }
        : {},
    });
  },
});
